package com.gyf.test;

import com.gyf.dao.IUserDao;
import com.gyf.model.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Lesson06 {

    @Test
    public void test1() throws Exception {

       //jdbcTemplate放在dao中
        ApplicationContext context = new ClassPathXmlApplicationContext("beans06.xml");
        IUserDao userDao = (IUserDao) context.getBean("userDao");
        User user = new User();
        user.setUsername("gyf");
        user.setPassword("123");
        userDao.add(user);
    }
}
